<extend name="Common:sysTemplate" />
<block name="content"><form action="" method="post" onsubmit="return pageAjaxSubmit();">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
        <tr>
            <th width="120">名称：</th>
            <td>
                <input name="name" type="text" class="input" size="40" value="{$info.name}" />
            </td>
        </tr>
        <tr>
            <th>上级部门：</th>
            <td>
                <select name="pid" style="min-width: 80px;">{$info.pidOption}</select>
            </td>
        </tr>
        <tr>
            <th>描 述：</th>
            <td>
                <textarea name="remark" style="width: 400px;">{$info.remark}</textarea>
            </td>
        </tr>
    </table>
    <input type="hidden" name="id" value="{$info.id}"/>
    <input type="hidden" name="level" value="<empty name="info['level']">1<else />{$info.level}</empty>"/>
    <div class="commonBtnArea" >
        <input  type="submit" value="提交" />
    </div>
</form>
</block>
<block name="footjs"><script type="text/javascript">
    function pageAjaxSubmit(){
        return commonAjaxSubmit();
    }
    $(function(){
        $("select[name='pid']").change(function(){
            var level= $("select[name='pid']").find("option:selected").attr('level');
            $("input[name='level']").val(parseInt(level)+1);
        });
    });
</script>
</block> 
